package com.bk.ouat.dao;

import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import com.bk.ouat.dto.UserDto;

@Repository
public class UserDao extends SqlSessionDaoSupport{
	

	public void addUser(UserDto userInfo) {
		getSqlSession().insert("userQuery.addUser", userInfo);
	}

	public int hasUserIdCount(UserDto userInfo) {
		return (Integer)getSqlSession().selectOne("userQuery.hasUserIdCount", userInfo);
	}

	public UserDto detailByMemberId(String userId) {
		return (UserDto)getSqlSession().selectOne("userQuery.detailByUserId", userId);
	}

	public Map login(UserDto userInfo) {
		return (Map)getSqlSession().selectOne("userQuery.login", userInfo);
	}

	
}
